package service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import dao.OrderDao;
import po.Order;

@Service("orderService")
@Transactional
public class OrderServiceImpl implements OrderService {
	@Autowired
	private OrderDao orderDao;
	
	@Override
	public List<Order> orderSelectAllOrder(int page) {
		// TODO Auto-generated method stub
		return orderDao.selectAllOrder(page);
	}

	@Override
	public int orderDelOrderBase(int id) {
		// TODO Auto-generated method stub
		return orderDao.deleteOrderBase(id);
	}

	@Override
	public int orderDelOrderDetail(int id) {
		// TODO Auto-generated method stub
		return orderDao.deleteOrderDetail(id);
	}

	@Override
	public List<Order> serciveSelectEml(Order order) {
		// TODO Auto-generated method stub
		return orderDao.selectEml(order);
	}

	@Override
	public int count() {
		// TODO Auto-generated method stub
		return (orderDao.count()+4)/5;
	}

}
